using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class ReligionAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public ReligionAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v23] = HL7TableType.User;
						tableVersionTypes[HL7Version.v24] = HL7TableType.User;
						tableVersionTypes[HL7Version.v25] = HL7TableType.User;
						tableVersionTypes[HL7Version.v251] = HL7TableType.User;
						tableVersionTypes[HL7Version.v26] = HL7TableType.User;
						tableVersionTypes[HL7Version.v27] = HL7TableType.User;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v23] = new string[]{""};
						validVersionCodes[HL7Version.v24] = new string[]{"AGN","ATH","BAH","BUD","BMA","BTH","BTA","BOT","CFR","CHR","ABC","AMT","AME","ANG","AOG","BAP","CAT","CRR","CHS","CMA","COC","COG","COI","COM","COL","EOT","EVC","EPI","FWB","FRQ","GRE","JWN","LUT","LMS","MEN","MET","MOM","NAZ","ORT","COT","PRC","PEN","COP","PRE","PRO","QUA","REC","REO","SAA","SEV","SOU","UCC","UMD","UNI","UNU","WES","WMC","CNF","ERL","HIN","HVA","HSH","HOT","JAI","JEW","JCO","JOR","JOT","JRC","JRF","JRN","MOS","MSU","MSH","MOT","NAM","NRL","NOE","OTH","SHN","SIK","SPI","VAR"};
						validVersionCodes[HL7Version.v25] = new string[]{"AGN","ATH","BAH","BUD","BMA","BTH","BTA","BOT","CFR","CHR","ABC","AMT","AME","ANG","AOG","BAP","CAT","CRR","CHS","CMA","COC","COG","COI","COM","COL","EOT","EVC","EPI","FWB","FRQ","GRE","JWN","LUT","LMS","MEN","MET","MOM","NAZ","ORT","COT","PRC","PEN","COP","PRE","PRO","QUA","REC","REO","SAA","SEV","SOU","UCC","UMD","UNI","UNU","WES","WMC","CNF","ERL","HIN","HVA","HSH","HOT","JAI","JEW","JCO","JOR","JOT","JRC","JRF","JRN","MOS","MSU","MSH","MOT","NAM","NRL","NOE","OTH","SHN","SIK","SPI","VAR"};
						validVersionCodes[HL7Version.v251] = new string[]{"AGN","ATH","BAH","BUD","BMA","BTH","BTA","BOT","CFR","CHR","ABC","AMT","AME","ANG","AOG","BAP","CAT","CRR","CHS","CMA","COC","COG","COI","COM","COL","EOT","EVC","EPI","FWB","FRQ","GRE","JWN","LUT","LMS","MEN","MET","MOM","NAZ","ORT","COT","PRC","PEN","COP","PRE","PRO","QUA","REC","REO","SAA","SEV","SOU","UCC","UMD","UNI","UNU","WES","WMC","CNF","ERL","HIN","HVA","HSH","HOT","JAI","JEW","JCO","JOR","JOT","JRC","JRF","JRN","MOS","MSU","MSH","MOT","NAM","NRL","NOE","OTH","SHN","SIK","SPI","VAR"};
						validVersionCodes[HL7Version.v26] = new string[]{"AGN","ATH","BAH","BRE","BUD","BMA","BTH","BTA","BOT","CFR","CHR","ABC","AMT","AME","ANG","AOG","BAP","CRR","CHS","CMA","COC","COG","COI","COM","COL","EOT","EVC","EPI","FWB","FRQ","FUL","GRE","JWN","MOM","LUT","LMS","MEN","MET","NAZ","ORT","PEN","COP","PRE","PRO","PRC","REC","REO","CAT","SAA","SEV","SOU","UCC","UMD","UNI","UNU","WES","WMC","COT","CNF","DOC","ERL","HIN","HSH","HVA","HOT","JAI","JEW","JCO","JOR","JRC","JRF","JRN","JOT","MOS","MSH","MSU","MOT","NAM","NRL","NOE","SHN","SIK","SPI","OTH","VAR"};
						validVersionCodes[HL7Version.v27] = new string[]{"AGN","ATH","BAH","BRE","BUD","BMA","BTH","BTA","BOT","CFR","CHR","ABC","AMT","AME","ANG","AOG","BAP","CRR","CHS","CMA","COC","COG","COI","COM","COL","EOT","EVC","EPI","FWB","FRQ","FUL","GRE","JWN","MOM","LUT","LMS","MEN","MET","NAZ","ORT","PEN","COP","PRE","PRO","PRC","REC","REO","CAT","SAA","SEV","SOU","UCC","UMD","UNI","UNU","WES","WMC","COT","CNF","DOC","ERL","HIN","HSH","HVA","HOT","JAI","JEW","JCO","JOR","JRC","JRF","JRN","JOT","MOS","MSH","MSU","MOT","NAM","NRL","NOE","SHN","SIK","SPI","OTH","VAR"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v23] = new string[]{""};
						validVersionDescriptions[HL7Version.v24] = new string[]{"Agnostic","Atheist","Baha'i","Buddhist","Buddhist: Mahayana","Buddhist: Theravada","Buddhist: Tantrayana","Buddhist: Other","Chinese Folk Religionist","Christian","Christian: American Baptist Church","Christian: African Methodist Episcopal","Christian: African Methodist Episcopal Zion","Christian: Anglican","Christian: Assembly of God","Christian: Baptist","Christian: Roman Catholic","Christian: Christian Reformed","Christian: Christian Science","Christian: Christian Missionary Alliance","Christian: Church of Christ","Christian: Church of God","Christian: Church of God in Christ","Christian: Community","Christian: Congregational","Christian: Eastern Orthodox","Christian: Evangelical Church","Christian: Episcopalian","Christian: Free Will Baptist","Christian: Friends","Christian: Greek Orthodox","Christian: Jehovah's Witness","Christian: Lutheran","Christian: Lutheran Missouri Synod","Christian: Mennonite","Christian: Methodist","Christian: Latter-day Saints","Christian: Church of the Nazarene","Christian: Orthodox","Christian: Other","Christian: Other Protestant","Christian: Pentecostal","Christian: Other Pentecostal","Christian: Presbyterian","Christian: Protestant","Christian: Friends","Christian: Reformed Church","Christian: Reorganized Church of Jesus Christ-LDS","Christian: Salvation Army","Christian: Seventh Day Adventist","Christian: Southern Baptist","Christian: United Church of Christ","Christian: United Methodist","Christian: Unitarian","Christian: Unitarian Universalist","Christian: Wesleyan","Christian: Wesleyan Methodist","Confucian","Ethnic Religionist","Hindu","Hindu: Vaishnavites","Hindu: Shaivites","Hindu: Other","Jain","Jewish","Jewish: Conservative","Jewish: Orthodox","Jewish: Other","Jewish: Reconstructionist","Jewish: Reform","Jewish: Renewal","Muslim","Muslim: Sunni","Muslim: Shiite","Muslim: Other","Native American","New Religionist","Nonreligious","Other","Shintoist","Sikh","Spiritist","Unknown"};
						validVersionDescriptions[HL7Version.v25] = new string[]{"Agnostic","Atheist","Baha'i","Buddhist","Buddhist: Mahayana","Buddhist: Theravada","Buddhist: Tantrayana","Buddhist: Other","Chinese Folk Religionist","Christian","Christian: American Baptist Church","Christian: African Methodist Episcopal","Christian: African Methodist Episcopal Zion","Christian: Anglican","Christian: Assembly of God","Christian: Baptist","Christian: Roman Catholic","Christian: Christian Reformed","Christian: Christian Science","Christian: Christian Missionary Alliance","Christian: Church of Christ","Christian: Church of God","Christian: Church of God in Christ","Christian: Community","Christian: Congregational","Christian: Eastern Orthodox","Christian: Evangelical Church","Christian: Episcopalian","Christian: Free Will Baptist","Christian: Friends","Christian: Greek Orthodox","Christian: Jehovah's Witness","Christian: Lutheran","Christian: Lutheran Missouri Synod","Christian: Mennonite","Christian: Methodist","Christian: Latter-day Saints","Christian: Church of the Nazarene","Christian: Orthodox","Christian: Other","Christian: Other Protestant","Christian: Pentecostal","Christian: Other Pentecostal","Christian: Presbyterian","Christian: Protestant","Christian: Friends","Christian: Reformed Church","Christian: Reorganized Church of Jesus Christ-LDS","Christian: Salvation Army","Christian: Seventh Day Adventist","Christian: Southern Baptist","Christian: United Church of Christ","Christian: United Methodist","Christian: Unitarian","Christian: Unitarian Universalist","Christian: Wesleyan","Christian: Wesleyan Methodist","Confucian","Ethnic Religionist","Hindu","Hindu: Vaishnavites","Hindu: Shaivites","Hindu: Other","Jain","Jewish","Jewish: Conservative","Jewish: Orthodox","Jewish: Other","Jewish: Reconstructionist","Jewish: Reform","Jewish: Renewal","Muslim","Muslim: Sunni","Muslim: Shiite","Muslim: Other","Native American","New Religionist","Nonreligious","Other","Shintoist","Sikh","Spiritist","Unknown"};
						validVersionDescriptions[HL7Version.v251] = new string[]{"Agnostic","Atheist","Baha'i","Buddhist","Buddhist: Mahayana","Buddhist: Theravada","Buddhist: Tantrayana","Buddhist: Other","Chinese Folk Religionist","Christian","Christian: American Baptist Church","Christian: African Methodist Episcopal","Christian: African Methodist Episcopal Zion","Christian: Anglican","Christian: Assembly of God","Christian: Baptist","Christian: Roman Catholic","Christian: Christian Reformed","Christian: Christian Science","Christian: Christian Missionary Alliance","Christian: Church of Christ","Christian: Church of God","Christian: Church of God in Christ","Christian: Community","Christian: Congregational","Christian: Eastern Orthodox","Christian: Evangelical Church","Christian: Episcopalian","Christian: Free Will Baptist","Christian: Friends","Christian: Greek Orthodox","Christian: Jehovah's Witness","Christian: Lutheran","Christian: Lutheran Missouri Synod","Christian: Mennonite","Christian: Methodist","Christian: Latter-day Saints","Christian: Church of the Nazarene","Christian: Orthodox","Christian: Other","Christian: Other Protestant","Christian: Pentecostal","Christian: Other Pentecostal","Christian: Presbyterian","Christian: Protestant","Christian: Friends","Christian: Reformed Church","Christian: Reorganized Church of Jesus Christ-LDS","Christian: Salvation Army","Christian: Seventh Day Adventist","Christian: Southern Baptist","Christian: United Church of Christ","Christian: United Methodist","Christian: Unitarian","Christian: Unitarian Universalist","Christian: Wesleyan","Christian: Wesleyan Methodist","Confucian","Ethnic Religionist","Hindu","Hindu: Vaishnavites","Hindu: Shaivites","Hindu: Other","Jain","Jewish","Jewish: Conservative","Jewish: Orthodox","Jewish: Other","Jewish: Reconstructionist","Jewish: Reform","Jewish: Renewal","Muslim","Muslim: Sunni","Muslim: Shiite","Muslim: Other","Native American","New Religionist","Nonreligious","Other","Shintoist","Sikh","Spiritist","Unknown"};
						validVersionDescriptions[HL7Version.v26] = new string[]{"Agnostic","Atheist","Baha'i","Brethren","Buddhist","Buddhist: Mahayana","Buddhist: Theravada","Buddhist: Tantrayana","Buddhist: Other","Chinese Folk Religionist","Christian","Christian: American Baptist Church","Christian: African Methodist Episcopal","Christian: African Methodist Episcopal Zion","Christian: Anglican","Christian: Assembly of God","Christian: Baptist","Christian: Christian Reformed","Christian: Christian Science","Christian: Christian Missionary Alliance","Christian: Church of Christ","Christian: Church of God","Christian: Church of God in Christ","Christian: Community","Christian: Congregational","Christian: Eastern Orthodox","Christian: Evangelical Church","Christian: Episcopalian","Christian: Free Will Baptist","Christian: Friends","Christian: Full Gospel","Christian: Greek Orthodox","Christian: Jehovah's Witness","Christian: Latter-day Saints","Christian: Lutheran","Christian: Lutheran Missouri Synod","Christian: Mennonite","Christian: Methodist","Christian: Church of the Nazarene","Christian: Orthodox","Christian: Pentecostal","Christian: Other Pentecostal","Christian: Presbyterian","Christian: Protestant","Christian: Other Protestant","Christian: Reformed Church","Christian: Reorganized Church of Jesus Christ-LDS","Christian: Roman Catholic","Christian: Salvation Army","Christian: Seventh Day Adventist","Christian: Southern Baptist","Christian: United Church of Christ","Christian: United Methodist","Christian: Unitarian","Christian: Unitarian Universalist","Christian: Wesleyan","Christian: Wesleyan Methodist","Christian: Other","Confucian","Disciples of Christ","Ethnic Religionist","Hindu","Hindu: Shaivites","Hindu: Vaishnavites","Hindu: Other","Jain","Jewish","Jewish: Conservative","Jewish: Orthodox","Jewish: Reconstructionist","Jewish: Reform","Jewish: Renewal","Jewish: Other","Muslim","Muslim: Shiite","Muslim: Sunni","Muslim: Other","Native American","New Religionist","Nonreligious","Shintoist","Sikh","Spiritist","Other","Unknown"};
						validVersionDescriptions[HL7Version.v27] = new string[]{"Agnostic","Atheist","Baha'i","Brethren","Buddhist","Buddhist: Mahayana","Buddhist: Theravada","Buddhist: Tantrayana","Buddhist: Other","Chinese Folk Religionist","Christian","Christian: American Baptist Church","Christian: African Methodist Episcopal","Christian: African Methodist Episcopal Zion","Christian: Anglican","Christian: Assembly of God","Christian: Baptist","Christian: Christian Reformed","Christian: Christian Science","Christian: Christian Missionary Alliance","Christian: Church of Christ","Christian: Church of God","Christian: Church of God in Christ","Christian: Community","Christian: Congregational","Christian: Eastern Orthodox","Christian: Evangelical Church","Christian: Episcopalian","Christian: Free Will Baptist","Christian: Friends","Christian: Full Gospel","Christian: Greek Orthodox","Christian: Jehovah's Witness","Christian: Latter-day Saints","Christian: Lutheran","Christian: Lutheran Missouri Synod","Christian: Mennonite","Christian: Methodist","Christian: Church of the Nazarene","Christian: Orthodox","Christian: Pentecostal","Christian: Other Pentecostal","Christian: Presbyterian","Christian: Protestant","Christian: Other Protestant","Christian: Reformed Church","Christian: Reorganized Church of Jesus Christ-LDS","Christian: Roman Catholic","Christian: Salvation Army","Christian: Seventh Day Adventist","Christian: Southern Baptist","Christian: United Church of Christ","Christian: United Methodist","Christian: Unitarian","Christian: Unitarian Universalist","Christian: Wesleyan","Christian: Wesleyan Methodist","Christian: Other","Confucian","Disciples of Christ","Ethnic Religionist","Hindu","Hindu: Shaivites","Hindu: Vaishnavites","Hindu: Other","Jain","Jewish","Jewish: Conservative","Jewish: Orthodox","Jewish: Reconstructionist","Jewish: Reform","Jewish: Renewal","Jewish: Other","Muslim","Muslim: Shiite","Muslim: Sunni","Muslim: Other","Native American","New Religionist","Nonreligious","Shintoist","Sikh","Spiritist","Other","Unknown"};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
